package org.feiye.studyday04;

import java.util.Scanner;

public class Grade {

	public static void main(String[] args) {
		// 循环输入某同学S1结业考试的5门课成绩，并计算平均分
		Scanner sc = new Scanner(System.in);
		double sum = 0;
		double avg = 0;
		double grade = 0;
		System.out.println("输入学生姓名：");
		String name = sc.next();
		for (int i = 0; i < 5; i++) {
			System.out.println("请输入" + name + "第" + (i + 1) + "门课的成绩：");
			grade = sc.nextDouble();
			sum += grade;
		}
		avg = sum / 5;
		System.out.println(name + "的平均分是" + avg);
	}

}
